package com.sjq.supplier.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sjq.supplier.mapper.EvaluationMapper;
import com.sjq.supplier.entity.Evaluation;
import com.sjq.supplier.service.EvaluationService;
import com.sjq.supplier.util.Result;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (Evaluation)表服务实现类
 *
 * @author makejava
 * @since 2024-01-02 14:54:50
 */
@Service("evaluationService")
public class EvaluationServiceImpl extends ServiceImpl<EvaluationMapper, Evaluation> implements EvaluationService {


    @Override
    public Result selectAll(Evaluation evaluation, Integer limit, Integer page) {
        List<Map<String, Object>> list= baseMapper.selectAll(evaluation,(page - 1) * limit , limit);
        HashMap<String, Object> result = new HashMap<>();
        result.put("count",baseMapper.selectAllCount(evaluation));
        result.put("data",list);
        return Result.success(result);
    }
}

